<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

{config_load file="default.conf" section="forms"}
{config_load file="create_account.conf"}

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$language->getLanguage()}" dir="{$language->getDirection()}">
	<head>
		{include file=$theme->getTemplateUrl("head_common.tpl")}
		<title>{#PAGE_TITLE#}</title>
	</head>
	
	<body>
		{include file=$theme->getTemplateUrl("body_start.tpl")}
		
		<h2>{#HEADING_TITLE#}</h2>
		
		<p>{$smarty.const.FILENAME_LOGIN|string_format:#TEXT_ORIGIN_LOGIN#}</p>
		
		<p>{#ENTRY_REQUIRED_TEXT#}{#ENTRY_REQUIRED#}</p>
		
		{if $messageStack->getSize("create_account") > 0}
			<p>{#FORM_ERROR_NOTICE#}</p>
			<ul class="errors">
				{foreach item="message" from=$messageStack->getMessages("create_account")}
					<li class="{$message.type}">{$theme->get_config_vars($message.message)}</li>
				{/foreach}
			</ul>
		{/if}
		
		<form name="create_account" action="{$smarty.const.FILENAME_CREATE_ACCOUNT}" method="post" onsubmit="return check_form(create_account);">
			<fieldset>
				<legend>{#CATEGORY_PERSONAL#}</legend>
				
				{if $smarty.const.ACCOUNT_GENDER}
					<span class="columnar">
						{#ENTRY_GENDER#}
						{if $form->fieldRequired("gender")}{#ENTRY_REQUIRED#}{/if}
					</span>
					
					<input type="radio" name="gender" id="gender_m" value="m"{if $smarty.post.gender == "m"} checked="checked"{/if} />
					<label for="gender_m">{#MALE#}</label>
					/
					<input type="radio" name="gender" id="gender_f" value="f"{if $smarty.post.gender == "f"} checked="checked"{/if} />
					<label for="gender_f">{#FEMALE#}</label>
				{/if}
				
				<br />
				
				<label class="columnar" for="firstname">
					{#ENTRY_FIRST_NAME#}
					{if $form->fieldRequired("firstname")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="firstname" id="firstname" value="{$smarty.post.firstname}" />
				
				<br />
				
				<label class="columnar" for="lastname">
					{#ENTRY_LAST_NAME#}
					{if $form->fieldRequired("lastname")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="lastname" id="lastname" value="{$smarty.post.lastname}" />
				
				<br />
				
				{if $smarty.const.ACCOUNT_DOB}
					<label class="columnar" for="dob">
						{#ENTRY_DATE_OF_BIRTH#}
						{if $form->fieldRequired("dob")}{#ENTRY_REQUIRED#}{/if}
					</label>
					
					<input type="text" name="dob" id="dob" value="{if $smarty.post.dob}{$smarty.post.dob}{else}{#SHORT_DATE_FORMAT#}{/if}" />
					
					<br />
				{/if}
				
				<label class="columnar" for="email_address">
					{#ENTRY_EMAIL_ADDRESS#}
					{if $form->fieldRequired("email_address")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="email_address" id="email_address" value="{$smarty.post.email_address}" />
			</fieldset>
			
			{if $smarty.const.ACCOUNT_COMPANY}
				<fieldset>
					<legend>{#CATEGORY_COMPANY#}</legend>
					
					<label class="columnar" for="company">
						{#ENTRY_COMPANY#}
						{if $form->fieldRequired("company")}{#ENTRY_REQUIRED#}{/if}
					</label>
					
					<input type="text" name="company" id="company" value="{$smarty.post.company}" />
				</fieldset>
			{/if}
			
			<fieldset>
				<legend>{#CATEGORY_ADDRESS#}</legend>
				
				<label class="columnar" for="street_address">
					{#ENTRY_STREET_ADDRESS#}
					{if $form->fieldRequired("street_address")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="street_address" id="street_address" value="{$smarty.post.street_address}" />
				
				<br />
				
				{if $smarty.const.ACCOUNT_SUBURB}
					<label class="columnar" for="suburb">
						{#ENTRY_SUBURB#}
						{if $form->fieldRequired("suburb")}{#ENTRY_REQUIRED#}{/if}
					</label>
					
					<input type="text" name="suburb" id="suburb" value="{$smarty.post.suburb}" />
					
					<br />
				{/if}
				
				<label class="columnar" for="city">
					{#ENTRY_CITY#}
					{if $form->fieldRequired("city")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="city" id="city" value="{$smarty.post.city}" />
				
				<br />
				
				{if $smarty.const.ACCOUNT_STATE}
					<label class="columnar" for="state">
						{#ENTRY_STATE#}
						{if $form->fieldRequired("state")}{#ENTRY_REQUIRED#}{/if}
					</label>
					
					{foreach name="zones" item="zone" from=$zones}
						{if $smarty.foreach.zones.first}
							<select name="state">
						{/if}
						
						<option value="{$zone}"{if $zone==$smarty.post.state} selected="selected"{/if}>{$zone}</option>
						
						{if $smarty.foreach.zones.last}
							</select>
						{/if}
					{foreachelse}
						<input type="text" name="state" id="state" value="{$smarty.post.state}" />
					{/foreach}
				{/if}
				
				<br />
				
				<label class="columnar" for="postcode">
					{#ENTRY_POST_CODE#}
					{if $form->fieldRequired("postcode")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="postcode" id="postcode" value="{$smarty.post.postcode}" />
				
				<br />
				
				<label class="columnar" for="country">
					{#ENTRY_COUNTRY#}
					{if $form->fieldRequired("country")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<select name="country" id="country">
					<option value="">{#PULL_DOWN_DEFAULT#}</option>
					{foreach item="country" from="$countries"}
						<option value="{$country.countries_id}"{if $country.countries_id == $smarty.post.country} selected="selected"{/if}>{$country.countries_name}</option>
					{/foreach}
				</select>
			</fieldset>
			
			<fieldset>
				<legend>{#CATEGORY_CONTACT#}</legend>
				
				<label class="columnar" for="telephone">
					{#ENTRY_TELEPHONE_NUMBER#}
					{if $form->fieldRequired("telephone")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="telephone" id="telephone" value="{$smarty.post.telephone}" />
				
				<br />
				
				<label class="columnar" for="fax">
					{#ENTRY_FAX_NUMBER#}
					{if $form->fieldRequired("fax")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="text" name="fax" id="fax" value="{$smarty.post.fax}" />
			</fieldset>
			
			<fieldset>
				<legend>{#CATEGORY_OPTIONS#}</legend>
				
				<input type="checkbox" name="newsletter" id="newsletter" value="yes" />
				
				<label for="newsletter">
					{#ENTRY_NEWSLETTER#}
					{if $form->fieldRequired("newsletter")}{#ENTRY_REQUIRED#}{/if}
				</label>
			</fieldset>
			
			<fieldset>
				<legend>{#CATEGORY_PASSWORD#}</legend>
				
				<label class="columnar" for="password">
					{#ENTRY_PASSWORD#}
					{if $form->fieldRequired("password")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="password" name="password" id="password" value="{$smarty.post.password}" />
				
				<br />
				
				<label class="columnar" for="confirmation">
					{#ENTRY_PASSWORD_CONFIRMATION#}
					{if $form->fieldRequired("confirmation")}{#ENTRY_REQUIRED#}{/if}
				</label>
				
				<input type="password" name="confirmation" id="confirmation" value="{if $smarty.post.confirmation == $smarty.post.password}{$smarty.post.confirmation}{/if}" />
			</fieldset>
			
			<p class="controls"><input type="submit" name="submit" value="{#TEXT_BUTTON_CREATE_ACCOUNT#}" /></p>
		</form>
		
		{include file=$theme->getTemplateUrl("body_end.tpl")}
	</body>
</html>
